package pl.pkolodziej.platform.dao.schedule;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import pl.pkolodziej.platform.vo.schedule.Schedule;
import pl.pkolodziej.platform.vo.user.User;

@Repository
public class ScheduleDAOImpl implements ScheduleDAO {

	@Autowired
	private SessionFactory sessionFactory;
	
	@Autowired
	HibernateTemplate hibernateTemplate;

	public void addSchedule(Schedule s) {
		sessionFactory.getCurrentSession().save(s);
	}
	
	public List<Schedule> listSchedule() {
		return sessionFactory.getCurrentSession().createQuery("from Schedule").list();
	}
	
	public void updatedSchedule(Schedule s) {
		sessionFactory.getCurrentSession().update(s);
	}
	
}
